import { App, Component } from 'vue';
import SvgIcon from '@/components/SvgIcon/index.vue'
import Pagination from '@/components/Pagination/index.vue'


interface GlobalComponent {
    [key: string]: Component;
  }

const allGlobalComponent:GlobalComponent = {SvgIcon, Pagination}

//对外暴露一个插件对象
export default {
    //务必叫做install方法
    install(app:App):void{
        Object.keys(allGlobalComponent).forEach(item=>{
            app.component(item,allGlobalComponent[item])
        })
        
    }
}